package com.zztl.infiniteBand.adapter

import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup

import com.alibaba.android.vlayout.DelegateAdapter
import com.alibaba.android.vlayout.LayoutHelper
import com.chad.library.adapter.base.BaseViewHolder

open class BaseDelegateAdapter(private val mContext: Context, private val mLayoutHelper: LayoutHelper, layoutId: Int, count: Int, viewTypeItem: Int) : DelegateAdapter.Adapter<BaseViewHolder>() {
    private var mCount :Int
    private var mLayoutId :Int
    private var mViewTypeItem :Int

    init {
        this.mCount = count
        this.mLayoutId = layoutId
        this.mViewTypeItem = viewTypeItem
    }

    override fun onCreateLayoutHelper(): LayoutHelper {
        return mLayoutHelper
    }

    override fun onCreateViewHolder(viewGroup: ViewGroup, viewType: Int): BaseViewHolder {
        return  BaseViewHolder(LayoutInflater.from(mContext).inflate(mLayoutId, viewGroup, false))

    }

    override fun onBindViewHolder(baseViewHolder: BaseViewHolder, i: Int) {

    }

    override fun getItemViewType(position: Int): Int {
        return mViewTypeItem
    }

    override fun getItemCount(): Int {
        return mCount
    }
}
